<template>
  <div>
    <!-- 可打印的内容 -->
    <div ref="printableContent">
      <content-to-print></content-to-print>
    </div>
    <!-- 打印按钮 -->
    <el-button style="float:right;" @click="printContent">打印</el-button>
  </div>
</template>
<script setup>
import { ref } from 'vue'
import printJS from 'print-js'
import contentToPrint from "@/components/print/component/contentToPrint.vue";
const printableContent = ref(null)
const printContent = () =>{
  // 使用print-js打印内容
  printJS({ printable: printableContent.value, type: 'html', scanStyles: false });
}
</script>

